package com.bblocks.enums.flowCommonBeans;

import java.util.HashMap;
import java.util.Map;

/**
 * @author : chenHongLai
 * @Description :
 * @Date : created in 2019/6/28 15:25.
 */
public enum FlowTradeCodeEnum {
	NEW_OFFICE_BUILDING(1, "新房_写字楼", "com.bblocks.daiketongFlow.service.impl.mapType.OfficeBuildingCommand", 4, 0, 0, 7),
    NEW_PIONEER_PARK(2, "新房_产业园", "com.bblocks.daiketongFlow.service.impl.mapType.SharedOfficeCommand", 4, 1, 0, 8),
    NEW_PARKING_SPACE(3,"新房_停车位", "com.bblocks.daiketongFlow.service.impl.mapType.ParkingSpaceCommand", 7, null, 0, 4),
    SECOND_HOUSE(4,"二手房_住宅", "com.bblocks.daiketongFlow.service.impl.mapType.YzSecondHouseCommand", 1, null, null, 2),
    SECOND_OFFICE_BUILDING(5,"二手房_写字楼", "com.bblocks.daiketongFlow.service.impl.mapType.OfficeBuildingCommand", 4, 0, 1, 7),
    SECOND_PIONEER_PARK(6,"二手房_产业园", "com.bblocks.daiketongFlow.service.impl.mapType.SharedOfficeCommand", 4, 1, 1, 8),
    SECOND_PARKING_SPACE(7,"二手房_停车位", "com.bblocks.daiketongFlow.service.impl.mapType.ParkingSpaceCommand", 7, null, 1, 4),
    SECOND_SHOPS(8,"二手房_商铺", "com.bblocks.daiketongFlow.service.impl.mapType.ShopsCommand", 6, null, 1, 5),
//    RETAL_HOUSE(9,"租房_住宅", ""),
    RETAL_OFFICE_BUILDING(10,"租房_写字楼", "com.bblocks.daiketongFlow.service.impl.mapType.OfficeBuildingCommand", 4, 0, 2, 7),
    RETAL_PIONEER_PARK(11,"租房_产业园", "com.bblocks.daiketongFlow.service.impl.mapType.SharedOfficeCommand", 4, 1, 2, 8),
    RETAL_SHARED_OFFICE(12,"租房_共享办公", "com.bblocks.daiketongFlow.service.impl.mapType.SharedOfficeCommand", 4, 2, 2, 9),
    NEW_HOUSE_RESIDENCE(13,"新房_住宅", "com.bblocks.daiketongFlow.service.impl.mapType.YzCommunityCommand", 0, null, null, 1),
    NEW_HOUSE_SHOP(14,"新房_商铺", "com.bblocks.daiketongFlow.service.impl.mapType.ShopsCommand", 6, null, 0, 5),
    RETAL_LONG(15,"租房_长租房", "com.bblocks.daiketongFlow.service.impl.mapType.YzLongRentalCommand", 2, null, null, 3),
    SHARED_OFFICE_WORK(16,"单间工位", "com.bblocks.daiketongFlow.service.impl.mapType.SharedOfficeWorkCommand", null, null, null, null),
    RETAL_SHOPS(17,"租房_商铺", "com.bblocks.daiketongFlow.service.impl.mapType.ShopsCommand", 6, null, 3, 5),
    DZ_LAND(18,"大宗_土地", "com.bblocks.daiketongFlow.service.impl.mapType.DzLandCommand", 9, null, null, null),
    DZ_CAPITAL(19,"大宗_资金", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_FIXED_ASSETS(20,"大宗_固定资产", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_NON_ASSETS(21,"大宗_不良资产","com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_NEGOTIABLE_SECURITIES(22,"大宗_证券", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_PROJECT(23,"大宗_创业项目", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_STOCK_RIGHT(24,"大宗_股权", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_ASSETS(25,"大宗_经营资产", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_JYXZ(26,"大宗_经营选址", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    DZ_JBSG(27,"大宗_兼并收购", "com.bblocks.daiketongFlow.service.impl.mapType.DzDetailsOfFundsCommand", 10, null, null, null),
    
    ZX_GS(28,"装修公司", "com.bblocks.daiketongFlow.service.impl.mapType.ZxCompanyCommand", null, null, null, null),
    SERVICE_GOODS(29,"服务商品", "com.bblocks.daiketongFlow.service.impl.mapType.ZxExampleCommand", null, null, null, null),
    LS_PROD(30,"电商商品", "com.bblocks.daiketongFlow.service.impl.mapType.ShopGoodsCommand", null, null, null, null),
//    BW_VIP(32,"爆文VIP", null, null, null, null, null),
    ;
    private Integer value;
    private String message;
    private String clazz;
    private Integer houseType;
    private Integer businessType;
    private Integer releaseType;
    private Integer couponType;
    private static final Map<Integer, String> className = new HashMap<Integer, String>();
    
    static {
        for (FlowTradeCodeEnum refer : FlowTradeCodeEnum.values()) {
        	className.put(refer.getValue(), refer.getClazz());
        }
    }

    public static Integer nameOf(Integer houseType, Integer businessType, Integer releaseType) {
        FlowTradeCodeEnum[] values = FlowTradeCodeEnum.values();
        for (FlowTradeCodeEnum statusEnum : values) {
            if (statusEnum.getHouseType() == houseType && statusEnum.getBusinessType() == businessType && statusEnum.getReleaseType() == releaseType) {
                return statusEnum.getValue();
            }
        }
        return null;
    }

    public static String valueOf(int value) {
        FlowTradeCodeEnum[] values = FlowTradeCodeEnum.values();
        for (FlowTradeCodeEnum stateEnum : values) {
            if (value == stateEnum.getValue()) {
                return stateEnum.getMessage();
            }
        }
        return null;
    }
    
    public static Map<String, Integer> typeOf(int value) {
    	Map<String, Integer> map = new HashMap<String, Integer>();
        FlowTradeCodeEnum[] values = FlowTradeCodeEnum.values();
        for (FlowTradeCodeEnum stateEnum : values) {
            if (value == stateEnum.getValue()) {
            	map.put("houseType", stateEnum.getHouseType());
            	map.put("businessType", stateEnum.getBusinessType());
            	map.put("releaseType", stateEnum.getReleaseType());
            	map.put("couponType", stateEnum.getCouponType());
                return map;
            }
        }
        return null;
    }

    FlowTradeCodeEnum(Integer value, String message, String clazz, Integer houseType, Integer businessType, Integer releaseType, Integer couponType) {
        this.value = value;
        this.message = message;
        this.clazz = clazz;
        this.houseType = houseType;
        this.businessType = businessType;
        this.releaseType = releaseType;
        this.couponType = couponType;
    }
    
    public static Map<Integer, String> getAllClazz() {
        return className;
    }

    public Integer getValue() {
        return value;
    }
    
    public String getMessage() {
        return message;
    }

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public Integer getHouseType() {
		return houseType;
	}

	public void setHouseType(Integer houseType) {
		this.houseType = houseType;
	}

	public Integer getBusinessType() {
		return businessType;
	}

	public void setBusinessType(Integer businessType) {
		this.businessType = businessType;
	}

	public Integer getReleaseType() {
		return releaseType;
	}

	public void setReleaseType(Integer releaseType) {
		this.releaseType = releaseType;
	}

	public Integer getCouponType() {
		return couponType;
	}

	public void setCouponType(Integer couponType) {
		this.couponType = couponType;
	}
    
    
}
